using System;
using DecisionMaking.Domain;
using DecisionMaking.BusinessLogic.Model;
namespace DecisionMaking.BusinessLogic
{
    /// <summary>
    /// Responsible for Account CRUD operations as well as the registration process
    /// </summary>
	public interface IAccountManager
	{		
		/// <summary>
		/// Creates the specified account in persistent storage. Password is encoded to MD5.
		/// </summary>
		/// <param name="model">
		/// A <see cref="RegisterModel"/>
		/// </param>
		/// <exception cref="DuplicateEmailException">If an account with the specified email already exists</exception>
		Account Register(RegisterModel model);
		
		/// <summary>
		/// Updates the specified account into persistent storage 
		/// </summary>
		/// <param name="model">
		/// A <see cref="UpdateAccountModel"/>
		/// </param>
		Account UpdateAccount(UpdateAccountModel model);
		
		/// <summary>
		/// Returns the account with the specified id or throws EntityNotFoundException if no such account exists 
		/// </summary>
		/// <param name="Id">
		/// A <see cref="System.Int32"/>
		/// </param>
		Account GetAccount(int id);
		
		/// <summary>
		/// Returns the account with the specified email addess and password or throws AccountNotFoundException if not found
		/// </summary>
		/// <param name="email">
		/// A <see cref="System.String"/>
		/// </param>
		/// <param name="password">
		/// A <see cref="System.String"/>
		/// </param>
		/// <returns>
		/// A <see cref="Account"/>
		/// </returns>
		Account GetAccountByCredentials(string email, String password);

        /// <summary>
        /// Returns the account with the specified email or throws AccountNotFoundException if not found
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        Account GetAccountByEmail(string email);
	}
}

